import { createApp } from 'vue';
import App from './App.vue';
import ElementPlus from 'element-plus';
import './style/config.scss';
import 'element-plus/dist/index.css';
import './style/element.scss';
import zhCn from 'element-plus/es/locale/lang/zh-cn';
import plugins from './plugins';
import router from './router';
import { componentIcon } from './utils/element-plus';
// import VueHighlightJS from 'vue-highlightjs';
import hljs from 'highlight.js';
import 'highlight.js/styles/github.css';
import './assets/font/font-awesome.css';

// 引入自己的UI框架
import MontUI from '../packages/index';
// import { MoButton } from '../packages/index';

const app = createApp(App);
// app.use(MoButton);
app.use(MontUI);
app.use(ElementPlus, { locale: zhCn });
app.use(router);
app.use(plugins);
app.use((app) => 
{
    app.directive('highlight', {
        mounted (el) 
        {
            let blocks = el.querySelectorAll('pre code');
            for (let i = 0; i < blocks.length; i++) 
            {
                hljs.highlightElement(blocks[i]);
            }
        }
    });
});
componentIcon(app);

app.mount('#app');
